<h2>Existing Judges to <%= @submission.user.display_name %>'s application for cycle <%= @submission.cycle.name %></h2>  
<% for judgment in @judgments -%>
<p><%= link_to judgment.judge.display_name, :controller => "account", :action => "show", :id => judgment.judge_id %> - [<%= link_to "remove", :controller => "submission", :action => "destroy_judgment", :id => judgment.id %>] - Score: <%= judgment.score ? judgment.score : "n/a" %><p>
<% end -%>
<h2>Add Another Judge</h2>
<% form_tag :action => 'assign_judge', :id => @submission do %>
	<p><strong>Choose Judge</strong>
		<%= select("site", "judge_id", 
		       Judge.find_by_sql("SELECT users.* 
		                              FROM users 
		                              JOIN roles_users on (roles_users.user_id = users.id) 
		                              JOIN roles on (roles_users.role_id = roles.id) 
		                             WHERE roles.name = 'Judge'").collect {|j| [ "#{j.display_name} - #{j.email} (#{j.judgments.count})", j.id ] }, {:include_blank => true}) %>
	</p> 
  <%= submit_tag 'Add' %>  
<% end -%>

<br />
<%= link_to "Back to work list", :controller => "workitem", :action => "list" %>